﻿using Microsoft.AspNetCore.Mvc;

namespace CDV.IRMS.WebAPI.TaskExecution.Utils
{
    /// <summary>
    /// ActionResult生成类
    /// </summary>
    public class ActionResultGenerator
    {
        /// <summary>
        /// 创建JsonResult对象
        /// </summary>
        /// <param name="taskID">任务ID</param>
        /// <param name="routeID">路由ID</param>
        /// <param name="errorMsg">错误信息</param>
        /// <returns>JsonResult对象</returns>
        public static IActionResult CreateJsonResult(int taskID, int routeID, string errorMsg = "")
        {
            return new JsonResult(new { TaskID = taskID, RouteID = routeID, ErrorMsg = errorMsg });
        }
    }
}
